<template>
	
</template>

<script>
import handlerHttpError from '@/utils/error';
import http from '@/utils/http';
import api from '@/api';
export default {
	data() {
		return {
			
		};
	},
	onShow() {
		this.getPoints();
		// #ifdef APP-PLUS
		this.model = plus.device.model;
		// #endif
	},
	methods: {
		// 获取当前用户积分信息
		getPoints() {
			http.get(api.member_points).then(res => {
				let { code, data, points } = res;
				if (code == 200) {
					this.list = data.task;
					this.points = data.points;
					this.list.forEach(item => {
						if (item.alias == 'sign_in') {
							this.isSignIn = item.is_done;
							this.signInPoints = item.points;
						}
					});
				}
			});
		},
		// 签到
		handlerSignin() {
			http.post(api.member_signin).then(res => {
				if (res.code == 200) {
					this.getPoints();
					this.$refs.signInPopup.open();
					// uni.showToast({
					// 	title:res.message,
					// 	icon:'none'
					// })
				}
			});
		},
		// 完成任务
		handlerTask(item) {
			switch (item.alias) {
				case 'bind_weixin':
				case 'bind_qq':
				case 'bind_sina':
					this.handleJump('/pages/settings/account');
					break;
				case 'upload_logo':
					this.handleJump('/pages/company/perfect/orderPage/addLogo', 'logo_src', '');
					break;
				case 'auth':
					this.handleJump('/pages/settings/auth');
					break;
				case 'upload_img':
					this.handleJump('/pages/company/perfect/orderPage/photo', 'imgList', []);
					break;
				case 'handle_resume':
					this.handleJump('/pages/company/ResumeManagement/ReceivedResume');
					break;
				case 'sign_in':
					this.handlerSignin();
					break;
				default:
					break;
			}
		},
		// 跳转
		/**
		 * @url 跳转路径
		 * @name 参数名称
		 * @params 参数
		 * */
		handleJump(url, name, params) {
			if (params) {
				uni.navigateTo({
					url: url + '?' + name + '=' + JSON.stringify(params)
				});
			} else {
				uni.navigateTo({
					url: url
				});
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.wrapper {
	width: 100%;
	height: 100%;
	background: #f8f8f8 url('@/service/static/img/integralSign.png') no-repeat top center / 100% auto;
	.orderList {
		text-align: right;
	}
	.inner {
		height: calc(100% - 130rpx);
		.info {
			height: 260rpx;
			// height: vh;
			background: url('@/service/static/img/signInInfoBg.png') no-repeat 630rpx center / 44rpx 123rpx;
			position: relative;
			.top {
				position: relative;
				// height: 170rpx;
				.t1 {
					color: #fff;
					font-size: 66rpx;
					padding-left: 53rpx;
				}
				.t2 {
					color: #fff;
					font-size: 26rpx;
					padding-left: 53rpx;
				}
				.t3 {
					position: absolute;
					right: 104rpx;
					top: 20rpx;
					color: #2755ff;
					font-size: 26rpx;
					padding: 14rpx 20rpx 14rpx 70rpx;
					border-radius: 30rpx 30rpx 0 30rpx;
					background: #fff url('@/service/static/img/singIn.png') no-repeat 30rpx center / 30rpx 30rpx;
					&.sign {
						background: #fff url('@/service/static/img/singInAc.png') no-repeat 30rpx center / 30rpx 30rpx;
						color: #999999;
					}
				}
			}
			.btns {
				position: absolute;
				bottom: 0;
				left: 0;
				right: 0;
				display: flex;
				background: rgba(255, 255, 255, 0.2);
				// background: red;
				padding: 25rpx 0;
				color: #fff;
				.btn {
					flex: 1;
					text-align: center;
					font-size: 28rpx;
					position: relative;
					.text {
						padding-left: 50rpx;
						&.bg1 {
							background: url('@/service/static/img/signInIcon9.png') no-repeat left center / 40rpx 40rpx;
						}
						&.bg2 {
							background: url('@/service/static/img/signInIcon10.png') no-repeat left center / 40rpx 40rpx;
						}
					}
					&.border {
						&:before {
							content: '';
							position: absolute;
							right: 0;
							top: 50%;
							transform: translateY(-50%);
							height: 20rpx;
							width: 2rpx;
							background: #ffffff;
						}
					}
				}
			}
		}
		.list {
			padding-top: 30rpx;
			height: calc(100% - 288rpx);
			margin: 0 36rpx;
			.item {
				padding: 22rpx;
				background: #fff;
				margin-bottom: 30rpx;
				border-radius: 10rpx;
				.img {
					width: 74rpx;
					height: 74rpx;
					margin-right: 20rpx;
					float: left;
					background: #ccc;
					border-radius: 50%;
					&.sign_in {
						background: url('@/service/static/img/signInIcon1.png') no-repeat center center / 100% 100%;
					}
					&.bind_weixin {
						background: url('@/service/static/img/signInIcon2.png') no-repeat center center / 100% 100%;
					}
					&.bind_qq {
						background: url('@/service/static/img/signInIcon3.png') no-repeat center center / 100% 100%;
					}
					&.upload_logo {
						background: url('@/service/static/img/signInIcon4.png') no-repeat center center / 100% 100%;
					}
					&.auth {
						background: url('@/service/static/img/signInIcon5.png') no-repeat center center / 100% 100%;
					}
					&.upload_img {
						background: url('@/service/static/img/signInIcon6.png') no-repeat center center / 100% 100%;
					}
					&.handle_resume {
						background: url('@/service/static/img/signInIcon7.png') no-repeat center center / 100% 100%;
					}
					&.reg {
						background: url('@/service/static/img/signInIcon8.png') no-repeat center center / 100% 100%;
					}
				}
				.text {
					float: left;
					width: 360rpx;
					margin-right: 20rpx;
					.t1 {
						color: #333333;
						font-size: 28rpx;
					}
					.t2 {
						color: #999999;
						font-size: 26rpx;
					}
				}
				.btn {
					float: left;
					width: 140rpx;
					height: 60rpx;
					text-align: center;
					line-height: 60rpx;
					float: left;
					border: 1rpx solid transparent;
					background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(0deg, #2755ff, #913aeb);
					background-origin: border-box;
					background-clip: content-box, border-box;
					color: #2755ff;
					font-size: 26rpx;
					border-radius: 50rpx;
					margin: 6rpx 0;
				}
				.btnAc {
					float: left;
					width: 140rpx;
					height: 72rpx;
					background: url('@/service/static/img/signAc.png') no-repeat center center / 140rpx 72rpx;
				}
			}
		}
	}
	.popupInner {
		position: relative;
		width: 673rpx;
		background: url('@/service/static/img/signInSuccess.png') no-repeat top center / 406rpx 402rpx;
		box-sizing: border-box;
		.popupClose {
			width: 54rpx;
			height: 54rpx;
			position: absolute;
			right: 0;
			top: 0;
			background: url('@/service/static/img/signInClose.png') no-repeat center center / 100% auto;
		}
		.tipsText {
			text-align: center;
			color: #fff;
			font-size: 30rpx;
			padding-top: 300rpx;
			.color {
				color: #f44b4b;
				margin: 0 10rpx;
			}
		}
		.btn {
			width: 230rpx;
			height: 74rpx;
			text-align: center;
			line-height: 74rpx;
			background: #19459d;
			border-radius: 40rpx;
			color: #fff;
			margin: 90rpx auto 0;
			font-size: 28rpx;
		}
	}
}
</style>
